const jwt = require("jsonwebtoken");

module.exports = (req,res)=>{
    const token = req.query.token;

    jwt.verify(token, "杨树林er", (err, data)=>{
        if(err){
            res.send({code:0, msg:"登录失效"});
        }else{
            res.send({code:1, msg:"登录有效", username:data.username});
        }
    })
}